home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D World 110
/
3DW_110.iso
/
mac
/
Menu
/
Scenes
/
home.dir
/
00042_Script_Open Media Player Rose
< prev
next >
Wrap
Text File
|
2008-09-12
|
3KB
|
141 lines
property Sp
property spriteList
property pRadius
property RoseOpen
property rosemode
property tc
property bWidth
property fWidth
property aRad
property degMod
property aDegMod
on beginsprite me
Sp = sprite(me.spritenum)
tc = 0
bWidth = 60
fWidth = 100
degMod = 90
aRad = 0
Sp.width = bWidth
Sp.height = bWidth
sprite(Sp).member.centerRegPoint = true
pRadius = 70
RoseOpen = false
SpriteList = [:]
SpriteList = [sprite(22),sprite(23),sprite(24),sprite(25),sprite(26)]
repeat with i = 1 to spriteList.count
SpriteList[i].loc = Sp.loc
SpriteList[i].visible = false
SpriteList[i].member.centerregPoint = true
end repeat
end
on Exitframe me
if RoseOpen = false then
if mGetDistance(the mouseLoc, Sp.loc) < pRadius then
OpenRose
RoseOpen = true
end if
end if
if (RoseOpen) then
if mGetDistance(the mouseLoc, Sp.loc) > pRadius + 20 then
CloseRose
RoseOpen = false
end if
end if
----Rose Scaling + Rotating Stuff Here
case RoseMode of
"exp":
if tc <> 1.0 then
tc = tc + 0.2
Sp.width = bWidth + float((fWidth - bWidth) * tc)
Sp.height = bWidth + float((fWidth - bWidth) * tc)
aDegMod = degMod * tc
aRad = pRadius * tc
else
RoseMode = "Open"
Sp.width = 89
Sp.height = 90
repeat with i = 1 to SpriteList.count
SpriteList[i].visible = true
end repeat
put tc
end if
"shk":
if tc > 0.00 then
tc = tc - 0.2
Sp.width = bWidth + float((fWidth - bWidth) * tc)
Sp.height = bWidth + float((fWidth - bWidth) * tc)
aDegMod = degMod * tc
aRad = pRadius * tc
else
RoseMode = "closed"
repeat with i = 1 to SpriteList.count
SpriteList[i].visible = false
end repeat
end if
end case
baseLoc = point(Sp.Loch, Sp.locv)
deg = 360 / SpriteList.count
repeat with o = 1 to SpriteList.count
SpLoc = getXYpos(vector(BaseLoc.loch, BaseLoc.locv,0), (deg*(o-1)) - adegmod, aRad)
SpriteList[o].loc = point(SpLoc.x, SpLoc.y)
SpriteList[o].blend = (tc * 100)
end repeat
end
on CloseRose
tc = 1.00
RoseMode = "shk"
end
on OpenRose
repeat with i = 1 to SpriteList.count
SpriteList[i].visible = true
SpriteList[i].blend = 0
end repeat
tc = 0
RoseMode = "exp"
end
on getXYPos Origin, ang, dist
myA = degreesToRads(ang)
return vector((origin.x + (dist * cos(myA))), (origin.y + (dist * sin(myA))), 0)
end
on degreesToRads aAngle
return aAngle * PI/180
end
on mGetDistance aPoint, AnotherPoint
--- Returns Distance between aPoint and AnotherPoint as a floating point number.
pDistance = sqrt(power((aPoint.locH - AnotherPoint.locH), 2) + power((aPoint.locV - AnotherPoint.locV), 2))
return pDistance
end